package jp.co.technotree.order.service;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;

import jp.co.technotree.common.controll.ApplicationContext;
import jp.co.technotree.common.controll.RequestContext;
import jp.co.technotree.common.dao.Transaction;
import jp.co.technotree.common.dao.TransactionManager;
import jp.co.technotree.dao.order.bean.OrderBean;
import jp.co.technotree.exception.TransactionException;

public class OrderListService {

	public ServletContext application;
	
	
	public String test(){
//				
//		ApplicationContext context = ApplicationContext.getInstance();
//		HttpServletRequest request = context.getRequestContext()
//		HttpSession session = request.getSession();
		
		ApplicationContext context = ApplicationContext.getInstance();
		RequestContext request = context.getRequestContext();
		HttpServletRequest session = request.getRequest();

		//共通項目---------START
		String path = application.getRealPath("/");
		ApplicationContext.init(path);
		//共通項目---------END
		
		String aaa = "asfasdfasdfasd";
		Transaction trx = null;
		try {
			trx = TransactionManager.getTransaction();
			trx.begin();
			
			
			
			
			
			trx.commit();
			
		} catch (TransactionException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		}
		
		System.out.println("---bbb-----");
		return aaa;
	}

	
	public OrderBean getTest(){
		OrderBean tesss = new OrderBean();
		
		tesss.setItemCd("AAAAA");
		tesss.setAcptKbn("aadfdfd");
		
		return tesss;
	}
}

